package com.example.bookmanagesystem.controller;


import com.example.bookmanagesystem.model.BookInfo;
import com.example.bookmanagesystem.service.BookService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;

@RestController
@RequestMapping("/book")
public class BookController {
    @Autowired  // 将BookService对象从IoC容器中取出来
    private BookService bookService;
    @RequestMapping("/getList")
    public List<BookInfo> getList() {
//        BookService bookService=new BookService();
        List<BookInfo> bookInfos=bookService.getList();
        return bookInfos;
    }
}
